package com.greensam.pixelengine.pojo.entity;

import com.greensam.pixelengine.pojo.base.BaseEntity;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.Comment;

/**
 * @author Ma Chengrui
 * @since 2025/9/18 17:49
 */
@Getter
@Setter
@Entity
@Table(name = "role_permission_rel",
        uniqueConstraints = {
                @UniqueConstraint(name = "uk_role_permission", columnNames = {"role_id", "permission_id"})
        },
        indexes = {
                @Index(name = "idx_role_id", columnList = "role_id"),
                @Index(name = "idx_permission_id", columnList = "permission_id")
        })
@Comment("角色-权限关联表")
public class RolePermissionPo extends BaseEntity {

    @Column(nullable = false, length = 20)
    @Comment("角色id")
    private Long roleId;

    @Column(nullable = false, length = 20)
    @Comment("权限id")
    private Long permissionId;

}
